package com.bena.udvtui2;

import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;


public class StandAloneView extends ListActivity {
	String[] listItems = {"exploring", "android", 
			"list", "activities"};
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
		setContentView(R.layout.list_view);
		setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, LOCATIONS));
		
		ListView lv = getListView();
	      lv.setTextFilterEnabled(true);

	      lv.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> arg0, View view, int arg2, long arg3) {
				Toast.makeText(getApplicationContext(), "Selected: "+((TextView) view).getText(), Toast.LENGTH_SHORT).show();				
			}
	      });
	}


	static final String[] LOCATIONS = new String[] {
		"Trabant", "Perkins", "Morris", "Evans", "Gore", "Sharp",
		"Wolf", "Memorial", "Du Pont", "Hullihen", "Mitchel",
		"Colburn", "Spencer"
	};
}